import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/home/Home.vue'

Vue.use(Router)

export default new Router({
  linkExactActiveClass: '',
  routes: [
    {
      path: '/',
      redirect: {
        name: 'Home'
      },
      component: Home
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/washCar',
      name: 'washCar',
      component: () => import(/* webpackChunkName: "washCar" */ './views/wash/washCar.vue') // 洗车
    },
    {
      path: '/buyBook',
      name: 'buyBook',
      component: () => import(/* webpackChunkName: "buyBook" */ './views/buy/BuyBook.vue') // 买手册
    },
    {
      path: '/me',
      name: 'Me',
      component: () => import(/* webpackChunkName: "me" */ './views/me/Me.vue'), // 我的
      children: [
        {
          path: 'address',
          name: 'MeAddress',
          component: () => import(/* webpackChunkName: "address" */ './views/me/children/address.vue') // 我的地址
        },
        {
          path: 'order',
          name: 'MeOrder',
          component: () => import(/* webpackChunkName: "order" */ './views/me/children/order.vue') // 我的订单
        },
        {
          path: 'opinion',
          name: 'MeOpinion',
          component: () => import(/* webpackChunkName: "opinion" */ './views/me/children/opinion.vue') // 我的意见
        },
        {
          path: 'like',
          name: 'MeLike',
          component: () => import(/* webpackChunkName: "like" */ './views/me/children/like.vue') // 我的赞
        },
        {
          path: 'activation',
          name: 'activation',
          component: () => import(/* webpackChunkName: "like" */ './views/me/children/activation.vue') // 我的赞
        },
        {
          path: 'about',
          name: 'MeAbout',
          component: () => import(/* webpackChunkName: "about" */ './views/me/children/about.vue') // 关于我们
        }
      ]
    },
    {
      path: '/detail/:id',
      name: 'detail',
      component: () => import(/* webpackChunkName: "about" */ './views/detail/Detail.vue') // 服务详情
    },
    {
      path: '/bookDetail/:id',
      name: 'bookDetail',
      component: () => import(/* webpackChunkName: "about" */ './views/bookDetail/BookDetail.vue') // 服务详情
    },
    {
      path: '*',
      name: 'NotFound',
      component: () => import(/* webpackChunkName: "about" */ './views/notFound/404.vue') // 404
    },
    {
      path: '/author',
      name: 'Author',
      component: () => import(/* webpackChunkName: "about" */ './views/author/author.vue') // 404
    },
    {
      path: '/result',
      name: 'Result',
      component: () => import(/* webpackChunkName: "about" */ './views/result/result.vue') // 支付
    }
  ]
})
